home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE03 / EXPERTS / MY1STEXP.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1995-07-07  |  1.5 KB  |  75 lines

  1. unit My1stexp;
  2. interface
  3. uses
  4.   WinTypes, Dialogs, ExptIntf;
  5.  
  6. Type
  7.   TMy1stExp = class(TIExpert)
  8.   public
  9.     { Expert Style }
  10.     function GetStyle: TExpertStyle; override;
  11.  
  12.     { Expert Strings }
  13.     function GetName: string; override;
  14.     function GetComment: string; override;
  15.     function GetGlyph: HBITMAP; override;
  16.     function GetState: TExpertState; override;
  17.     function GetIDString: string; override;
  18.     function GetMenuText: string; override;
  19.  
  20.     { Launch the Expert }
  21.     procedure Execute; override;
  22.   end;
  23.  
  24.   procedure Register;
  25.  
  26. implementation
  27.  
  28.   function TMy1stExp.GetStyle: TExpertStyle;
  29.   begin
  30.     Result := esStandard
  31.   end;
  32.  
  33.   function TMy1stExp.GetName: String;
  34.   begin
  35.     Result := 'My First Expert'
  36.   end;
  37.  
  38.   function TMy1stExp.GetComment: String;
  39.   begin
  40.     Result := '' { not needed for esStandard }
  41.   end;
  42.  
  43.   function TMy1stExp.GetGlyph: HBITMAP;
  44.   begin
  45.     Result := 0 { not needed for esStandard }
  46.   end;
  47.  
  48.   function TMy1stExp.GetState: TExpertState;
  49.   begin
  50.     Result := [esEnabled]
  51.   end;
  52.  
  53.   function TMy1stExp.GetIDString: String;
  54.   begin
  55.     Result := 'DrBob.MyFirstExpert'
  56.   end;
  57.  
  58.   function TMy1stExp.GetMenuText: String;
  59.   begin
  60.     Result := '&My First Expert...'
  61.   end;
  62.  
  63.   procedure TMy1stExp.Execute;
  64.   begin
  65.     MessageDlg('Hello World: My First Expert is alive!',
  66.                 mtInformation, [mbOk], 0)
  67.   end;
  68.  
  69.   procedure Register;
  70.   begin
  71.     RegisterLibraryExpert(TMy1stExp.Create)
  72.   end;
  73.  
  74. end.
  75.